from ronglian_sms_sdk import SmsSDK

accId = '2c94811c946f6bfb0195fa4abd9d43e6'
accToken = 'b6f4f0602aa14259ae695d447f069e72'
appId = '2c94811c946f6bfb0195fa4abf3e43ed'


class SMSClient:
    def __init__(self):
        self.sdk = SmsSDK(accId, accToken, appId)

    def send_message(self, phone, code):
        tid = "1"
        mobile = phone
        datas = (code,)
        resp = self.sdk.sendMessage(tid, mobile, datas)
        return resp


# 创建一个全局实例供外部使用
sm = SMSClient()
